package code;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class Ordinal_FinalResults2 {
	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new FileReader("C:\\Users\\mtnguyen.2012\\Downloads\\svm_light_windows (1)\\ordinal_classifier\\fold-1\\output005"));		
		BufferedReader br2 = new BufferedReader(new FileReader("C:\\Users\\mtnguyen.2012\\Downloads\\svm_light_windows (1)\\ordinal_classifier\\fold-1\\output005_"));		
		BufferedWriter bw = new BufferedWriter(new FileWriter("C:\\Users\\mtnguyen.2012\\Downloads\\svm_light_windows (1)\\ordinal_classifier\\fold-1\\finalresult005"));
		
		int total = 0;
		
//		int numRows = 200042;
		int numRows = 768668;
		
		for(int i=0; i<numRows; i++){
			String line = br.readLine();
			String[] f = line.split(" ");
			Double cls = Double.parseDouble(f[0]);
			
			String line_nonpos = br2.readLine();
			String[] f_nonpos = line_nonpos.split(" ");
			Double cls_nonpos = Double.parseDouble(f_nonpos[0]);
			
			if(cls > 0) {
				bw.write("1"+"\n");
				total++;
			}
			else {
				if(cls_nonpos < 0){
					bw.write("0"+"\n");
					total++;
				}
				else {
					bw.write("-1"+"\n");
					total++;
				}
			}
		}		
		
		br.close();		
		br2.close();
		bw.close();
		
		System.out.println("Total "+total);
	}

}
